@import "../common/var.styl"
.bin-date-picker {
  display: inline-block;
  line-height: normal;
  width: 100%;
  &-rel {
    position: relative;
  }
  .bin-select-dropdown {
    width: auto;
    padding: 0;
    overflow: visible;
    max-height: none;
  }
  &-header {
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-bottom: 1px solid #e8eaec;
    &-label {
      cursor: pointer;
      transition: color .2s ease-in-out;
      &:hover {
        color: $color-primary;
      }
    }
  }
  &-prev-btn {
    float: left;
    &-arrow-double {
      margin-left: 10px;
      i:after {
        content: "\e7f3";
        margin-left: -8px;
      }
    }
  }
  &-next-btn {
    float: right;
    &-arrow-double {
      margin-right: 10px;
      i:after {
        content: "\e7fd";
        margin-left: -8px;
      }
    }
  }
  &-cells {
    width: 196px;
    margin: 10px;
    white-space: normal;
    span {
      display: inline-block;
      width: 24px;
      height: 24px;
      em {
        display: inline-block;
        width: 24px;
        height: 24px;
        line-height: 24px;
        margin: 2px;
        font-style: normal;
        border-radius: 3px;
        text-align: center;
        transition: all .2s ease-in-out;
      }
    }
    &-header span {
      line-height: 24px;
      text-align: center;
      margin: 2px;
      color: $btn-disable-color;
    }
    &-cell:hover {
      em {
        background: #e1f0fe;
      }
    }
    &-focused {
      em {
        box-shadow: 0 0 0 1px $color-primary inset;
      }
    }

    &-cell {
      span& {
        width: 28px;
        height: 28px;
        cursor: pointer;
      }
      &-prev-month, &-next-month {
        em {
          color: $btn-disable-color;
        }
        &:hover {
          em {
            background: transparent;
          }
        }
      }
      span&-week-label, span&-week-label:hover, span&-disabled, span&-disabled:hover {
        cursor: not-allowed;
        color: $btn-disable-color;
        em {
          color: inherit;
          background: inherit;
        }
      }
      span&-disabled, span&-disabled:hover {
        background: #f7f7f7;
      }
      &-today {
        em {
          position: relative;
          box-shadow: 0 0 0 1px $color-primary inset;
          &:after {
            position: absolute;
            top: 1px;
            right: 1px;
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: $color-primary;
          }
        }
      }
      &-range {
        position: relative;
        em {
          position: relative;
          z-index: 1;
        }
        &:before {
          content: '';
          display: block;
          background: #e1f0fe;
          border-radius: 0;
          border: 0;
          position: absolute;
          top: 2px;
          bottom: 2px;
          left: 0;
          right: 0;
        }
      }
      &-selected, &-selected:hover {
        em {
          background: $color-primary;
          color: #fff;
        }
      }
      span&-disabled&-selected {
        em {
          background: $btn-disable-color;
          color: #f7f7f7;
        }
      }
      &-today&-selected {
        em {
          &:after {
            background: #fff;
          }
        }
      }
    }
  }
  &-cells-show-week-numbers {
    width: 226px;
  }
  &-cells-year, &-cells-month {
    margin-top: 14px;
    span {
      width: 40px;
      height: 28px;
      line-height: 28px;
      margin: 10px 12px;
      border-radius: 3px;
      em {
        width: 40px;
        height: 28px;
        line-height: 28px;
        margin: 0;
      }
    }

    .bin-date-picker-cells-cell-focused {
      background-color: $color-primary-light1
    }

  }
  &-with-range {
    .bin-picker-panel {
      &-body {
        min-width: (196px + 20) * 2;
      }
      &-content {
        float: left;
      }
    }
    .bin-picker-cells-show-week-numbers {
      min-width: (226px + 20) * 2;
    }
  } \
  &-with-week-numbers {
    .bin-picker-panel {
      &-body-date {
        min-width: (226px + 20) * 2;
      }
    }
  }

  &-transfer {
    z-index: 1060;
    max-height: none;
    width: auto;
  }

  &-focused input {
    border-color: tint($color-primary, 20%);
    outline: 0;
    box-shadow: 0 0 0 2px fade($color-primary, 20%);
  }
}

.bin-picker {
  &-panel {
    &-icon-btn {
      display: inline-block;
      width: 20px;
      height: 24px;
      line-height: 26px;
      margin-top: 4px;
      text-align: center;
      cursor: pointer;
      color: $btn-disable-color;
      transition: color .2s ease-in-out;
      &:hover {
        color: $color-primary;
      }
      i {
        font-size: 14px;
      }
    }
    &-body-wrapper&-with-sidebar {
      padding-left: 92px;
    }
    &-sidebar {
      width: 92px;
      float: left;
      margin-left: -92px;
      position: absolute;
      top: 0;
      bottom: 0;
      background: #f8f8f9;
      border-right: 1px solid #e8eaec;
      border-radius: 3px 0 0 3px;
      overflow: auto;
    }
    &-shortcut {
      padding: 6px 15px 6px 15px;
      transition: all .2s ease-in-out;
      cursor: pointer;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: #515a6e;
      &:hover {
        background: #e8eaec;
      }
    }
    &-body {
      float: left;
    }
  }
  &-confirm {
    border-top: 1px solid #e8eaec;
    text-align: right;
    padding: 8px;
    clear: both;
    & > span {
      color: #2D8cF0;
      cursor: pointer;
      user-select: none;
      float: left;
      padding: 2px 0;
      transition: all .2s ease-in-out;
      &:hover {
        color: tint(#2D8cF0, 20%);
      }
      &:active {
        color: shade(#2D8cF0, 5%);
      }
    }
    &-time {
      float: left;
    }
    .bin-button--mini {
      padding: 1px 7px 2px;
      font-size: 12px;
      line-height: 1.5em;
    }
  }
}
